package com.example.blog.mapper;

import com.example.blog.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Optional;

@Mapper
public interface UserMapper {

    User selectById(Long id);

    Optional<User> selectByUsername(String username);

    Optional<User> selectByEmail(String email);

    int insert(User user);

    int update(User user);

    int deleteById(Long id);

    boolean existsByUsername(String username);

    boolean existsByEmail(String email);

}